
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>应用02 服务器进化 · Python-Tutorial</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="网络02 服务器进化.html" />
    
    
    <link rel="prev" href="网络01 原始服务器.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        <li class="header">Python基础</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="基础.html">
            
                <a href="基础.html">
            
                    
                    Python基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="01.html">
            
                <a href="01.html">
            
                    
                    基础01 Hello World!
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.1" data-path="01.html">
            
                <a href="01.html#python命令行">
            
                    
                    Python命令行
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.2" data-path="01.html">
            
                <a href="01.html#写一段小程序">
            
                    
                    写一段小程序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.3" data-path="01.html">
            
                <a href="01.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="02.html">
            
                <a href="02.html">
            
                    
                    基础02 基本数据类型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.2.1" data-path="02.html">
            
                <a href="02.html#变量不需要声明">
            
                    
                    变量不需要声明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.2" data-path="02.html">
            
                <a href="02.html#回收变量名">
            
                    
                    回收变量名
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.3" data-path="02.html">
            
                <a href="02.html#基本数据类型">
            
                    
                    基本数据类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.4" data-path="02.html">
            
                <a href="02.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="03.html">
            
                <a href="03.html">
            
                    
                    基础03 序列
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.3.1" data-path="03.html">
            
                <a href="03.html#sequence-序列">
            
                    
                    sequence 序列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.2" data-path="03.html">
            
                <a href="03.html#元素的引用">
            
                    
                    元素的引用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.3" data-path="03.html">
            
                <a href="03.html#其他引用方式">
            
                    
                    其他引用方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.4" data-path="03.html">
            
                <a href="03.html#字符串是元组">
            
                    
                    字符串是元组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.5" data-path="03.html">
            
                <a href="03.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="04.html">
            
                <a href="04.html">
            
                    
                    基础04 运算
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.4.1" data-path="04.html">
            
                <a href="04.html#数学运算">
            
                    
                    数学运算
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.2" data-path="04.html">
            
                <a href="04.html#分支">
            
                    
                    分支
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.3" data-path="04.html">
            
                <a href="04.html#逻辑运算">
            
                    
                    逻辑运算
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.4" data-path="04.html">
            
                <a href="04.html#pythonic-数据交换">
            
                    
                    Pythonic 数据交换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.5" data-path="04.html">
            
                <a href="04.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="05.html">
            
                <a href="05.html">
            
                    
                    基础05 缩进和选择
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.5.1" data-path="05.html">
            
                <a href="05.html#缩进">
            
                    
                    缩进
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5.2" data-path="05.html">
            
                <a href="05.html#if语句">
            
                    
                    if语句
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5.3" data-path="05.html">
            
                <a href="05.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="06.html">
            
                <a href="06.html">
            
                    
                    基础06 循环
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.6.1" data-path="06.html">
            
                <a href="06.html#for循环">
            
                    
                    for循环
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6.2" data-path="06.html">
            
                <a href="06.html#while循环">
            
                    
                    while循环
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6.3" data-path="06.html">
            
                <a href="06.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="07.html">
            
                <a href="07.html">
            
                    
                    基础07 函数
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.7.1" data-path="07.html">
            
                <a href="07.html#函数的定义">
            
                    
                    函数的定义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7.2" data-path="07.html">
            
                <a href="07.html#函数调用和参数传递">
            
                    
                    函数调用和参数传递
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7.3" data-path="07.html">
            
                <a href="07.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="08.html">
            
                <a href="08.html">
            
                    
                    基础08 面向对象的基本概念
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.8.1" data-path="08.html">
            
                <a href="08.html#相近对象，归为类">
            
                    
                    相近对象，归为类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.2" data-path="08.html">
            
                <a href="08.html#动作">
            
                    
                    动作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.3" data-path="08.html">
            
                <a href="08.html#子类">
            
                    
                    子类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.4" data-path="08.html">
            
                <a href="08.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="09.html">
            
                <a href="09.html">
            
                    
                    基础09 面向对象的进一步拓展
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.9.1" data-path="09.html">
            
                <a href="09.html#调用类的其它信息">
            
                    
                    调用类的其它信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.2" data-path="09.html">
            
                <a href="09.html#init方法">
            
                    
                    __init__()方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.3" data-path="09.html">
            
                <a href="09.html#对象的性质">
            
                    
                    对象的性质
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.10" data-path="10.html">
            
                <a href="10.html">
            
                    
                    基础10 反过头来看看
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.10.1" data-path="10.html">
            
                <a href="10.html#list是一个类">
            
                    
                    list是一个类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10.2" data-path="10.html">
            
                <a href="10.html#运算符是特殊方法">
            
                    
                    运算符是特殊方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10.3" data-path="10.html">
            
                <a href="10.html#下一步">
            
                    
                    下一步
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10.4" data-path="10.html">
            
                <a href="10.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">Python进阶</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="进阶.html">
            
                <a href="进阶.html">
            
                    
                    进阶
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="intermediate01.html">
            
                <a href="intermediate01.html">
            
                    
                    进阶01 词典
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1.1" data-path="intermediate01.html">
            
                <a href="intermediate01.html#基本概念">
            
                    
                    基本概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.2" data-path="intermediate01.html">
            
                <a href="intermediate01.html#词典元素的循环调用">
            
                    
                    词典元素的循环调用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.3" data-path="intermediate01.html">
            
                <a href="intermediate01.html#词典的常用方法">
            
                    
                    词典的常用方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.4" data-path="intermediate01.html">
            
                <a href="intermediate01.html#词典排序">
            
                    
                    词典排序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.5" data-path="intermediate01.html">
            
                <a href="intermediate01.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="intermediate02.html">
            
                <a href="intermediate02.html">
            
                    
                    进阶02 文本文件的输入输出
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.2.1" data-path="intermediate02.html">
            
                <a href="intermediate02.html#创建文件对象">
            
                    
                    创建文件对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.2" data-path="intermediate02.html">
            
                <a href="intermediate02.html#文件对象的方法">
            
                    
                    文件对象的方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.3" data-path="intermediate02.html">
            
                <a href="intermediate02.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="intermediate03.html">
            
                <a href="intermediate03.html">
            
                    
                    进阶03 模块
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.3.1" data-path="intermediate03.html">
            
                <a href="intermediate03.html#引入模块">
            
                    
                    引入模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.2" data-path="intermediate03.html">
            
                <a href="intermediate03.html#搜索路径">
            
                    
                    搜索路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.3" data-path="intermediate03.html">
            
                <a href="intermediate03.html#模块包">
            
                    
                    模块包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.4" data-path="intermediate03.html">
            
                <a href="intermediate03.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.4" data-path="intermediate04.html">
            
                <a href="intermediate04.html">
            
                    
                    进阶04 函数的参数对应
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.4.1" data-path="intermediate04.html">
            
                <a href="intermediate04.html#关键字传递">
            
                    
                    关键字传递
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.2" data-path="intermediate04.html">
            
                <a href="intermediate04.html#参数默认值">
            
                    
                    参数默认值
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.3" data-path="intermediate04.html">
            
                <a href="intermediate04.html#包裹传递">
            
                    
                    包裹传递
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.4" data-path="intermediate04.html">
            
                <a href="intermediate04.html#解包裹">
            
                    
                    解包裹
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.5" data-path="intermediate04.html">
            
                <a href="intermediate04.html#混合">
            
                    
                    混合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.6" data-path="intermediate04.html">
            
                <a href="intermediate04.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.5" data-path="intermediate05.html">
            
                <a href="intermediate05.html">
            
                    
                    进阶05 循环设计
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.5.1" data-path="intermediate05.html">
            
                <a href="intermediate05.html#range">
            
                    
                    range()
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5.2" data-path="intermediate05.html">
            
                <a href="intermediate05.html#enumerate">
            
                    
                    enumerate()
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5.3" data-path="intermediate05.html">
            
                <a href="intermediate05.html#zip">
            
                    
                    zip()
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5.4" data-path="intermediate05.html">
            
                <a href="intermediate05.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.6" data-path="intermediate06.html">
            
                <a href="intermediate06.html">
            
                    
                    进阶06 循环对象
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.6.1" data-path="intermediate06.html">
            
                <a href="intermediate06.html#什么是循环对象">
            
                    
                    什么是循环对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.6.2" data-path="intermediate06.html">
            
                <a href="intermediate06.html#迭代器">
            
                    
                    迭代器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.6.3" data-path="intermediate06.html">
            
                <a href="intermediate06.html#生成器">
            
                    
                    生成器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.6.4" data-path="intermediate06.html">
            
                <a href="intermediate06.html#表推导">
            
                    
                    表推导
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.6.5" data-path="intermediate06.html">
            
                <a href="intermediate06.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.7" data-path="intermediate07.html">
            
                <a href="intermediate07.html#">
            
                    
                    进阶07 函数对象
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.7.1" data-path="intermediate07.html">
            
                <a href="intermediate07.html#lambda函数">
            
                    
                    lambda函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.2" data-path="intermediate07.html">
            
                <a href="intermediate07.html#函数作为参数传递">
            
                    
                    函数作为参数传递
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.3" data-path="intermediate07.html">
            
                <a href="intermediate07.html#map函数">
            
                    
                    map()函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.4" data-path="intermediate07.html">
            
                <a href="intermediate07.html#filter函数">
            
                    
                    filter()函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.5" data-path="intermediate07.html">
            
                <a href="intermediate07.html#reduce函数">
            
                    
                    reduce()函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.6" data-path="intermediate07.html">
            
                <a href="intermediate07.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.8" data-path="intermediate08.html">
            
                <a href="intermediate08.html#">
            
                    
                    进阶08 异常处理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.8.1" data-path="intermediate08.html">
            
                <a href="intermediate08.html#异常处理">
            
                    
                    异常处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.8.2" data-path="intermediate08.html">
            
                <a href="intermediate08.html#抛出异常">
            
                    
                    抛出异常
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.8.3" data-path="intermediate08.html">
            
                <a href="intermediate08.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.9" data-path="intermediate09.html">
            
                <a href="intermediate09.html#">
            
                    
                    进阶09 动态类型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.9.1" data-path="intermediate09.html">
            
                <a href="intermediate09.html#动态类型">
            
                    
                    动态类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.9.2" data-path="intermediate09.html">
            
                <a href="intermediate09.html#从动态类型看函数的参数传递">
            
                    
                    从动态类型看函数的参数传递
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.9.3" data-path="intermediate09.html">
            
                <a href="intermediate09.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="快速教程总结.html">
            
                <a href="快速教程总结.html">
            
                    
                    快速教程总结
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="小题目 针对快速教程.html">
            
                <a href="小题目 针对快速教程.html">
            
                    
                    小题目 针对快速教程
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Python深入</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="深入.html">
            
                <a href="深入.html">
            
                    
                    Python深入
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.1" data-path="深入01 特殊方法与多范式.html">
            
                <a href="深入01 特殊方法与多范式.html#python深入01-特殊方法与多范式">
            
                    
                    深入01 特殊方法与多范式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.1.1" data-path="深入01 特殊方法与多范式.html">
            
                <a href="深入01 特殊方法与多范式.html#运算符">
            
                    
                    运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.1.2" data-path="深入01 特殊方法与多范式.html">
            
                <a href="深入01 特殊方法与多范式.html#内置函数">
            
                    
                    内置函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.1.3" data-path="深入01 特殊方法与多范式.html">
            
                <a href="深入01 特殊方法与多范式.html#表list元素引用">
            
                    
                    表(list)元素引用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.1.4" data-path="深入01 特殊方法与多范式.html">
            
                <a href="深入01 特殊方法与多范式.html#函数">
            
                    
                    函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.1.5" data-path="深入01 特殊方法与多范式.html">
            
                <a href="深入01 特殊方法与多范式.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.1.2" data-path="深入02 上下文管理器.html">
            
                <a href="深入02 上下文管理器.html">
            
                    
                    深入02 上下文管理器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.2.1" data-path="深入02 上下文管理器.html">
            
                <a href="深入02 上下文管理器.html#关闭文件">
            
                    
                    关闭文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.2.2" data-path="深入02 上下文管理器.html">
            
                <a href="深入02 上下文管理器.html#自定义">
            
                    
                    自定义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.2.3" data-path="深入02 上下文管理器.html">
            
                <a href="深入02 上下文管理器.html#总结：">
            
                    
                    总结：
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.1.3" data-path="深入03 对象的属性.html">
            
                <a href="深入03 对象的属性.html">
            
                    
                    深入03 对象的属性
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.3.1" data-path="深入03 对象的属性.html">
            
                <a href="深入03 对象的属性.html#属性的dict系统">
            
                    
                    属性的__dict__系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.3.2" data-path="深入03 对象的属性.html">
            
                <a href="深入03 对象的属性.html#特性">
            
                    
                    特性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.3.3" data-path="深入03 对象的属性.html">
            
                <a href="深入03 对象的属性.html#使用特殊方法getattr">
            
                    
                    使用特殊方法__getattr__
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.3.4" data-path="深入03 对象的属性.html">
            
                <a href="深入03 对象的属性.html#即时生成属性的其他方式">
            
                    
                    即时生成属性的其他方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.3.5" data-path="深入03 对象的属性.html">
            
                <a href="深入03 对象的属性.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.1.4" data-path="深入04 闭包.html">
            
                <a href="深入04 闭包.html">
            
                    
                    深入04 闭包
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.4.1" data-path="深入04 闭包.html">
            
                <a href="深入04 闭包.html#函数对象的作用域">
            
                    
                    函数对象的作用域
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.4.2" data-path="深入04 闭包.html">
            
                <a href="深入04 闭包.html#闭包">
            
                    
                    闭包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.4.3" data-path="深入04 闭包.html">
            
                <a href="深入04 闭包.html#闭包与并行运算">
            
                    
                    闭包与并行运算
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.1.5" data-path="深入05 装饰器.html">
            
                <a href="深入05 装饰器.html">
            
                    
                    深入05 装饰器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.5.1" data-path="深入05 装饰器.html">
            
                <a href="深入05 装饰器.html#装饰函数和方法">
            
                    
                    装饰函数和方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.5.2" data-path="深入05 装饰器.html">
            
                <a href="深入05 装饰器.html#含参的装饰器">
            
                    
                    含参的装饰器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.5.3" data-path="深入05 装饰器.html">
            
                <a href="深入05 装饰器.html#装饰类">
            
                    
                    装饰类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.5.4" data-path="深入05 装饰器.html">
            
                <a href="深入05 装饰器.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.1.6" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html">
            
                    
                    深入06 内存管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.6.1" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html#对象的内存使用">
            
                    
                    对象的内存使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6.2" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html#对象引用对象">
            
                    
                    对象引用对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6.3" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html#引用减少">
            
                    
                    引用减少
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6.4" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html#垃圾回收">
            
                    
                    垃圾回收
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6.5" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html#分代回收">
            
                    
                    分代回收
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6.6" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html#孤立的引用环">
            
                    
                    孤立的引用环
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6.7" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">Python补充</li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="补充.html">
            
                <a href="补充.html">
            
                    
                    Python补充
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.1" data-path="补充01 序列的方法.html">
            
                <a href="补充01 序列的方法.html">
            
                    
                    补充01 序列的方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html">
            
                    
                    补充02 小技巧
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.2.1" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#import模块">
            
                    
                    import模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2.2" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#查询">
            
                    
                    查询
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2.3" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#使用中文以及其它非ascii编码">
            
                    
                    使用中文(以及其它非ASCII编码)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2.4" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#表示2进制，8进制和16进制数字">
            
                    
                    表示2进制，8进制和16进制数字
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2.5" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#注释">
            
                    
                    注释
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2.6" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#搜索路径">
            
                    
                    搜索路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2.7" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#脚本与命令行结合">
            
                    
                    脚本与命令行结合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2.8" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#安装非标准包">
            
                    
                    安装非标准包
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.1.3" data-path="补充03 内置函数清单.html">
            
                <a href="补充03 内置函数清单.html">
            
                    
                    补充03 内置函数清单
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.3.1" data-path="补充03 内置函数清单.html">
            
                <a href="补充03 内置函数清单.html#数学运算">
            
                    
                    数学运算
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.3.2" data-path="补充03 内置函数清单.html">
            
                <a href="补充03 内置函数清单.html#类型转换">
            
                    
                    类型转换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.3.3" data-path="补充03 内置函数清单.html">
            
                <a href="补充03 内置函数清单.html#类，对象，属性">
            
                    
                    序列操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.3.4" data-path="补充03 内置函数清单.html">
            
                <a href="补充03 内置函数清单.html#编译，执行">
            
                    
                    编译，执行
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.3.5" data-path="补充03 内置函数清单.html">
            
                <a href="补充03 内置函数清单.html#其他">
            
                    
                    其他
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.1.4" data-path="补充04 简史.html">
            
                <a href="补充04 简史.html">
            
                    
                    补充04 简史
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.4.1" data-path="补充04 简史.html">
            
                <a href="补充04 简史.html#python的起源">
            
                    
                    Python的起源
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.4.2" data-path="补充04 简史.html">
            
                <a href="补充04 简史.html#python的诞生">
            
                    
                    Python的诞生
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.4.3" data-path="补充04 简史.html">
            
                <a href="补充04 简史.html#python启示录">
            
                    
                    Python启示录
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.1.5" data-path="补充05 字符串格式化.html">
            
                <a href="补充05 字符串格式化.html">
            
                    
                    补充05 字符串格式化 (%操作符)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.5.1" data-path="补充05 字符串格式化.html">
            
                <a href="补充05 字符串格式化.html#模板">
            
                    
                    模板
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.5.2" data-path="补充05 字符串格式化.html">
            
                <a href="补充05 字符串格式化.html#格式符">
            
                    
                    格式符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.5.3" data-path="补充05 字符串格式化.html">
            
                <a href="补充05 字符串格式化.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.1.6" data-path="补充06 python之道.html">
            
                <a href="补充06 python之道.html">
            
                    
                    补充06 Python之道
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.6.1" data-path="补充06 python之道.html">
            
                <a href="补充06 python之道.html#历史">
            
                    
                    历史
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">Python标准库</li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="标准库.html">
            
                <a href="标准库.html">
            
                    
                    Python标准库
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.1" data-path="标准库——走马观花.html">
            
                <a href="标准库——走马观花.html">
            
                    
                    标准库——走马观花
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.1.1" data-path="标准库——走马观花.html">
            
                <a href="标准库——走马观花.html#第一类：python增强">
            
                    
                    第一类：Python增强
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.1.2" data-path="标准库——走马观花.html">
            
                <a href="标准库——走马观花.html#第二类：系统互动">
            
                    
                    第二类：系统互动
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.1.3" data-path="标准库——走马观花.html">
            
                <a href="标准库——走马观花.html#第三类：网络">
            
                    
                    第三类：网络
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.2" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html">
            
                    
                    标准库的学习准备
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.2.1" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html#硬件原理">
            
                    
                    硬件原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.2.2" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html#操作系统">
            
                    
                    操作系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.2.3" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html#网络">
            
                    
                    网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.2.4" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html#算法与数据结构">
            
                    
                    算法与数据结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.2.5" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html#数据库">
            
                    
                    数据库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.2.6" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html#加密和文本编码">
            
                    
                    加密和文本编码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.2.7" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.3" data-path="STL01.html">
            
                <a href="STL01.html">
            
                    
                    标准库01 正则表达式 (re包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.3.1" data-path="STL01.html">
            
                <a href="STL01.html#语法">
            
                    
                    语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.3.2" data-path="STL01.html">
            
                <a href="STL01.html#正则表达式的函数">
            
                    
                    正则表达式的函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.3.3" data-path="STL01.html">
            
                <a href="STL01.html#写一个正则表达式">
            
                    
                    写一个正则表达式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.3.4" data-path="STL01.html">
            
                <a href="STL01.html#对比research和rematch">
            
                    
                    对比re.search和re.match
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.3.5" data-path="STL01.html">
            
                <a href="STL01.html#练习">
            
                    
                    练习
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.3.6" data-path="STL01.html">
            
                <a href="STL01.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.4" data-path="STL02.html">
            
                <a href="STL02.html">
            
                    
                    标准库02 时间与日期 (time, datetime包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.4.1" data-path="STL02.html">
            
                <a href="STL02.html#time包">
            
                    
                    time包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.4.2" data-path="STL02.html">
            
                <a href="STL02.html#datetime包">
            
                    
                    datetime包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.4.3" data-path="STL02.html">
            
                <a href="STL02.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.5" data-path="STL03.html">
            
                <a href="STL03.html">
            
                    
                    标准库03 路径与文件 (os.path包, glob包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.5.1" data-path="STL03.html">
            
                <a href="STL03.html#ospath包">
            
                    
                    os.path包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.5.2" data-path="STL03.html">
            
                <a href="STL03.html#glob包">
            
                    
                    glob包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.5.3" data-path="STL03.html">
            
                <a href="STL03.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.6" data-path="STL04.html">
            
                <a href="STL04.html">
            
                    
                    标准库04 文件管理 (部分os包，shutil包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.6.1" data-path="STL04.html">
            
                <a href="STL04.html#os包">
            
                    
                    os包
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.7" data-path="STL05.html">
            
                <a href="STL05.html">
            
                    
                    标准库05 存储对象 (pickle包，cPickle包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.7.1" data-path="STL05.html">
            
                <a href="STL05.html#pickle包">
            
                    
                    pickle包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.7.2" data-path="STL05.html">
            
                <a href="STL05.html#cpickle包">
            
                    
                    cPickle包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.7.3" data-path="STL05.html">
            
                <a href="STL05.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.8" data-path="STL06.html">
            
                <a href="STL06.html">
            
                    
                    标准库06 子进程 (subprocess包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.8.1" data-path="STL06.html">
            
                <a href="STL06.html#subprocess以及常用的封装函数">
            
                    
                    subprocess以及常用的封装函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.8.2" data-path="STL06.html">
            
                <a href="STL06.html#popen(">
            
                    
                    Popen()
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.8.3" data-path="STL06.html">
            
                <a href="STL06.html#子进程的文本流控制">
            
                    
                    子进程的文本流控制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.8.4" data-path="STL06.html">
            
                <a href="STL06.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.9" data-path="STL07.html">
            
                <a href="STL07.html">
            
                    
                    标准库07 信号 (signal包，部分os包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.9.1" data-path="STL07.html">
            
                <a href="STL07.html#定义信号名">
            
                    
                    定义信号名
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.9.2" data-path="STL07.html">
            
                <a href="STL07.html#预设信号处理函数">
            
                    
                    预设信号处理函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.9.3" data-path="STL07.html">
            
                <a href="STL07.html#定时发出sigalrm信号">
            
                    
                    定时发出SIGALRM信号
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.9.4" data-path="STL07.html">
            
                <a href="STL07.html#发送信号">
            
                    
                    发送信号
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.9.5" data-path="STL07.html">
            
                <a href="STL07.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.10" data-path="STL08.html">
            
                <a href="STL08.html">
            
                    
                    标准库08 多线程与同步 (threading包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.10.1" data-path="STL08.html">
            
                <a href="STL08.html#多线程售票以及同步">
            
                    
                    多线程售票以及同步
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.10.2" data-path="STL08.html">
            
                <a href="STL08.html#oop创建线程">
            
                    
                    OOP创建线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.10.3" data-path="STL08.html">
            
                <a href="STL08.html#其他">
            
                    
                    其他
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.10.4" data-path="STL08.html">
            
                <a href="STL08.html#练习">
            
                    
                    练习
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.10.5" data-path="STL08.html">
            
                <a href="STL08.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.11" data-path="STL09.html">
            
                <a href="STL09.html">
            
                    
                    标准库09 当前进程信息 (部分os包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.11.1" data-path="STL09.html">
            
                <a href="STL09.html#进程信息">
            
                    
                    进程信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.11.2" data-path="STL09.html">
            
                <a href="STL09.html#saved-uid和saved-gid">
            
                    
                    saved UID和saved GID
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.11.3" data-path="STL09.html">
            
                <a href="STL09.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.12" data-path="STL10.html">
            
                <a href="STL10.html">
            
                    
                    标准库10 多进程初步 (multiprocessing包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.12.1" data-path="STL10.html">
            
                <a href="STL10.html#threading和multiprocessing">
            
                    
                    threading和multiprocessing
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.12.2" data-path="STL10.html">
            
                <a href="STL10.html#Pipe和Queue">
            
                    
                    Pipe和Queue
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.12.3" data-path="STL10.html">
            
                <a href="STL10.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.13" data-path="STL11.html">
            
                <a href="STL11.html">
            
                    
                    标准库11 多进程探索 (multiprocessing包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.13.1" data-path="STL11.html">
            
                <a href="STL11.html#进程池">
            
                    
                    进程池
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.13.2" data-path="STL11.html">
            
                <a href="STL11.html#练习">
            
                    
                    练习
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.13.3" data-path="STL11.html">
            
                <a href="STL11.html#共享资源">
            
                    
                    共享资源
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.13.3.1" data-path="STL11.html">
            
                <a href="STL11.html#共享内存">
            
                    
                    共享内存
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.13.3.2" data-path="STL11.html">
            
                <a href="STL11.html#manager">
            
                    
                    Manager
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.13.4" data-path="STL11.html">
            
                <a href="STL11.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.14" data-path="STL12.html">
            
                <a href="STL12.html">
            
                    
                    标准库12 数学与随机数 (math包，random包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.14.1" data-path="STL12.html">
            
                <a href="STL12.html#math包">
            
                    
                    math包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.14.2" data-path="STL12.html">
            
                <a href="STL12.html#random包">
            
                    
                    random包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.14.3" data-path="STL12.html">
            
                <a href="STL12.html#练习">
            
                    
                    练习
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.14.4" data-path="STL12.html">
            
                <a href="STL12.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.15" data-path="STL13 循环器 itertools.html">
            
                <a href="STL13 循环器 itertools.html">
            
                    
                    标准库13 循环器 (itertools)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.15.1" data-path="STL13 循环器 itertools.html">
            
                <a href="STL13 循环器 itertools.html#无穷循环器">
            
                    
                    无穷循环器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.15.2" data-path="STL13 循环器 itertools.html">
            
                <a href="STL13 循环器 itertools.html#函数式工具">
            
                    
                    函数式工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.15.3" data-path="STL13 循环器 itertools.html">
            
                <a href="STL13 循环器 itertools.html#组合工具">
            
                    
                    组合工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.15.4" data-path="STL13 循环器 itertools.html">
            
                <a href="STL13 循环器 itertools.html#groupby">
            
                    
                    groupby()
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.15.5" data-path="STL13 循环器 itertools.html">
            
                <a href="STL13 循环器 itertools.html#其它工具">
            
                    
                    其它工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.15.6" data-path="STL13 循环器 itertools.html">
            
                <a href="STL13 循环器 itertools.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.16" data-path="STL14 数据库 sqlite3.html">
            
                <a href="STL14 数据库 sqlite3.html">
            
                    
                    标准库14 数据库 (sqlite3)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.16.1" data-path="STL14 数据库 sqlite3.html">
            
                <a href="STL14 数据库 sqlite3.html#创建数据库">
            
                    
                    创建数据库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.16.2" data-path="STL14 数据库 sqlite3.html">
            
                <a href="STL14 数据库 sqlite3.html#插入数据">
            
                    
                    插入数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.16.3" data-path="STL14 数据库 sqlite3.html">
            
                <a href="STL14 数据库 sqlite3.html#查询">
            
                    
                    查询
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.16.4" data-path="STL14 数据库 sqlite3.html">
            
                <a href="STL14 数据库 sqlite3.html#更新与删除">
            
                    
                    更新与删除
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.16.5" data-path="STL14 数据库 sqlite3.html">
            
                <a href="STL14 数据库 sqlite3.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">Python应用</li>
        
        
    
        <li class="chapter " data-level="6.1" data-path="应用.html">
            
                <a href="应用.html">
            
                    
                    Python应用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1.1" data-path="网络01 原始服务器.html">
            
                <a href="网络01 原始服务器.html">
            
                    
                    应用01 原始服务器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1.1.1" data-path="网络01 原始服务器.html">
            
                <a href="网络01 原始服务器.html#tcpip和socket">
            
                    
                    TCP/IP和socket
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.1.2" data-path="网络01 原始服务器.html">
            
                <a href="网络01 原始服务器.html#tcp-socket">
            
                    
                    TCP socket
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.1.3" data-path="网络01 原始服务器.html">
            
                <a href="网络01 原始服务器.html#基于tcp-socket的http服务器">
            
                    
                    基于TCP socket的HTTP服务器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.1.4" data-path="网络01 原始服务器.html">
            
                <a href="网络01 原始服务器.html#深入http服务器程序">
            
                    
                    深入HTTP服务器程序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.1.5" data-path="网络01 原始服务器.html">
            
                <a href="网络01 原始服务器.html#使用浏览器实验">
            
                    
                    使用浏览器实验
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.1.6" data-path="网络01 原始服务器.html">
            
                <a href="网络01 原始服务器.html#探索的方向">
            
                    
                    探索的方向
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="6.1.2" data-path="网络02 服务器进化.html">
            
                <a href="网络02 服务器进化.html">
            
                    
                    应用02 服务器进化
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1.2.1" data-path="网络02 服务器进化.html">
            
                <a href="网络02 服务器进化.html#支持post">
            
                    
                    支持POST
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.2.2" data-path="网络02 服务器进化.html">
            
                <a href="网络02 服务器进化.html#使用socketserver">
            
                    
                    使用SocketServer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.2.3" data-path="网络02 服务器进化.html">
            
                <a href="网络02 服务器进化.html#simplehttpserver:-使用静态文件来回应请求">
            
                    
                    SimpleHTTPServer: 使用静态文件来回应请求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.2.4" data-path="网络02 服务器进化.html">
            
                <a href="网络02 服务器进化.html#cgihttpserver：使用静态文件或者cgi来回应请求">
            
                    
                    CGIHTTPServer：使用静态文件或者CGI来回应请求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.2.5" data-path="网络02 服务器进化.html">
            
                <a href="网络02 服务器进化.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6.1.3" data-path="网络03 使用pyqt制作视频播放器.html">
            
                <a href="网络03 使用pyqt制作视频播放器.html">
            
                    
                    应用03 使用PyQT制作视频播放器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1.3.1" data-path="网络03 使用pyqt制作视频播放器.html">
            
                <a href="网络03 使用pyqt制作视频播放器.html#视频播放器">
            
                    
                    视频播放器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.3.2" data-path="网络03 使用pyqt制作视频播放器.html">
            
                <a href="网络03 使用pyqt制作视频播放器.html#视图部分">
            
                    
                    视图部分
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.3.3" data-path="网络03 使用pyqt制作视频播放器.html">
            
                <a href="网络03 使用pyqt制作视频播放器.html#多线程">
            
                    
                    多线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.3.4" data-path="网络03 使用pyqt制作视频播放器.html">
            
                <a href="网络03 使用pyqt制作视频播放器.html#信号与槽">
            
                    
                    信号与槽
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">被解放的姜戈</li>
        
        
    
        <li class="chapter " data-level="7.1" data-path="被解放的姜戈.html">
            
                <a href="被解放的姜戈.html">
            
                    
                    被解放的姜戈
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.1" data-path="被解放的姜戈01 初试天涯.html">
            
                <a href="被解放的姜戈01 初试天涯.html">
            
                    
                    被解放的姜戈01 初试天涯
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.1.1" data-path="被解放的姜戈01 初试天涯.html">
            
                <a href="被解放的姜戈01 初试天涯.html#安装django">
            
                    
                    安装Django
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.1.2" data-path="被解放的姜戈01 初试天涯.html">
            
                <a href="被解放的姜戈01 初试天涯.html#启动">
            
                    
                    启动
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.1.3" data-path="被解放的姜戈01 初试天涯.html">
            
                <a href="被解放的姜戈01 初试天涯.html#第一个网页">
            
                    
                    第一个网页
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.1.4" data-path="被解放的姜戈01 初试天涯.html">
            
                <a href="被解放的姜戈01 初试天涯.html#增加app">
            
                    
                    增加app
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.1.5" data-path="被解放的姜戈01 初试天涯.html">
            
                <a href="被解放的姜戈01 初试天涯.html#增加app页面">
            
                    
                    增加APP页面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.1.6" data-path="被解放的姜戈01 初试天涯.html">
            
                <a href="被解放的姜戈01 初试天涯.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.1.2" data-path="被解放的姜戈02 庄园疑云.html">
            
                <a href="被解放的姜戈02 庄园疑云.html">
            
                    
                    被解放的姜戈02 庄园疑云
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.2.1" data-path="被解放的姜戈02 庄园疑云.html">
            
                <a href="被解放的姜戈02 庄园疑云.html#连接数据库">
            
                    
                    连接数据库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.2.2" data-path="被解放的姜戈02 庄园疑云.html">
            
                <a href="被解放的姜戈02 庄园疑云.html#创立模型">
            
                    
                    创立模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.2.3" data-path="被解放的姜戈02 庄园疑云.html">
            
                <a href="被解放的姜戈02 庄园疑云.html#显示数据">
            
                    
                    显示数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.2.4" data-path="被解放的姜戈02 庄园疑云.html">
            
                <a href="被解放的姜戈02 庄园疑云.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.1.3" data-path="被解放的姜戈03 所谓伊人.html">
            
                <a href="被解放的姜戈03 所谓伊人.html">
            
                    
                    被解放的姜戈03 所谓伊人
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.3.1" data-path="被解放的姜戈03 所谓伊人.html">
            
                <a href="被解放的姜戈03 所谓伊人.html#模板初体验">
            
                    
                    模板初体验
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.3.2" data-path="被解放的姜戈03 所谓伊人.html">
            
                <a href="被解放的姜戈03 所谓伊人.html#流程">
            
                    
                    流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.3.3" data-path="被解放的姜戈03 所谓伊人.html">
            
                <a href="被解放的姜戈03 所谓伊人.html#循环与选择">
            
                    
                    循环与选择
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.3.4" data-path="被解放的姜戈03 所谓伊人.html">
            
                <a href="被解放的姜戈03 所谓伊人.html#模板继承">
            
                    
                    模板继承
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.3.5" data-path="被解放的姜戈03 所谓伊人.html">
            
                <a href="被解放的姜戈03 所谓伊人.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.1.4" data-path="被解放的姜戈04 各取所需.html">
            
                <a href="被解放的姜戈04 各取所需.html">
            
                    
                    被解放的姜戈04 各取所需
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.4.1" data-path="被解放的姜戈04 各取所需.html">
            
                <a href="被解放的姜戈04 各取所需.html#html表格">
            
                    
                    html表格
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.4.2" data-path="被解放的姜戈04 各取所需.html">
            
                <a href="被解放的姜戈04 各取所需.html#post方法">
            
                    
                    POST方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.4.3" data-path="被解放的姜戈04 各取所需.html">
            
                <a href="被解放的姜戈04 各取所需.html#存储数据">
            
                    
                    存储数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.4.4" data-path="被解放的姜戈04 各取所需.html">
            
                <a href="被解放的姜戈04 各取所需.html#表格对象">
            
                    
                    表格对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.4.5" data-path="被解放的姜戈04 各取所需.html">
            
                <a href="被解放的姜戈04 各取所需.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.1.5" data-path="被解放的姜戈05 黑面管家.html">
            
                <a href="被解放的姜戈05 黑面管家.html">
            
                    
                    被解放的姜戈05 黑面管家
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.5.1" data-path="被解放的姜戈05 黑面管家.html">
            
                <a href="被解放的姜戈05 黑面管家.html#默认界面">
            
                    
                    默认界面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.5.2" data-path="被解放的姜戈05 黑面管家.html">
            
                <a href="被解放的姜戈05 黑面管家.html#复杂模型">
            
                    
                    复杂模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.5.3" data-path="被解放的姜戈05 黑面管家.html">
            
                <a href="被解放的姜戈05 黑面管家.html#自定义页面">
            
                    
                    自定义页面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.5.4" data-path="被解放的姜戈05 黑面管家.html">
            
                <a href="被解放的姜戈05 黑面管家.html#inline显示">
            
                    
                    Inline显示
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.5.5" data-path="被解放的姜戈05 黑面管家.html">
            
                <a href="被解放的姜戈05 黑面管家.html#列表页的显示">
            
                    
                    列表页的显示
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.5.6" data-path="被解放的姜戈05 黑面管家.html">
            
                <a href="被解放的姜戈05 黑面管家.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.1.6" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html">
            
                    
                    被解放的姜戈06 假作真时
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.6.1" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html#创建用户">
            
                    
                    创建用户
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.6.2" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html#用户登录">
            
                    
                    用户登录
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.6.3" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html#登出">
            
                    
                    登出
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.6.4" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html#viewspy中的用户">
            
                    
                    views.py中的用户
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.6.5" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html#模板中的用户">
            
                    
                    模板中的用户
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.6.6" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html#用户注册">
            
                    
                    用户注册
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.6.7" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.1.7" data-path="被解放的姜戈07 马不停蹄.html">
            
                <a href="被解放的姜戈07 马不停蹄.html">
            
                    
                    被解放的姜戈07 马不停蹄
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.7.1" data-path="被解放的姜戈07 马不停蹄.html">
            
                <a href="被解放的姜戈07 马不停蹄.html#安装">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.7.2" data-path="被解放的姜戈07 马不停蹄.html">
            
                <a href="被解放的姜戈07 马不停蹄.html#静态文件">
            
                    
                    静态文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.7.3" data-path="被解放的姜戈07 马不停蹄.html">
            
                <a href="被解放的姜戈07 马不停蹄.html#其它">
            
                    
                    其它
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.7.4" data-path="被解放的姜戈07 马不停蹄.html">
            
                <a href="被解放的姜戈07 马不停蹄.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.1.8" data-path="被解放的姜戈08 远走高飞.html">
            
                <a href="被解放的姜戈08 远走高飞.html">
            
                    
                    被解放的姜戈08 远走高飞
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.8.1" data-path="被解放的姜戈08 远走高飞.html">
            
                <a href="被解放的姜戈08 远走高飞.html#阿里云准备">
            
                    
                    阿里云准备
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.8.2" data-path="被解放的姜戈08 远走高飞.html">
            
                <a href="被解放的姜戈08 远走高飞.html#安装django">
            
                    
                    安装Django
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.8.3" data-path="被解放的姜戈08 远走高飞.html">
            
                <a href="被解放的姜戈08 远走高飞.html#安装数据库和http服务器">
            
                    
                    安装数据库和HTTP服务器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.8.4" data-path="被解放的姜戈08 远走高飞.html">
            
                <a href="被解放的姜戈08 远走高飞.html#运行django服务器">
            
                    
                    运行Django服务器
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="尾声.html">
            
                <a href="尾声.html">
            
                    
                    快速教程 尾声
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >应用02 服务器进化</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="python&#x7F51;&#x7EDC;02-python&#x670D;&#x52A1;&#x5668;&#x8FDB;&#x5316;">Python&#x7F51;&#x7EDC;02 Python&#x670D;&#x52A1;&#x5668;&#x8FDB;&#x5316;</h1>
<p><strong>&#x6CE8;&#x610F;&#xFF0C;&#x5728;Python 3.x&#x4E2D;&#xFF0C;BaseHTTPServer, SimpleHTTPServer, CGIHTTPServer&#x6574;&#x5408;&#x5230;http.server&#x5305;&#xFF0C;SocketServer&#x6539;&#x540D;&#x4E3A;socketserver&#xFF0C;&#x8BF7;&#x6CE8;&#x610F;&#x67E5;&#x9605;&#x5B98;&#x65B9;&#x6587;&#x6863;&#x3002;</strong></p>
<p>&#x5728;&#x4E0A;&#x4E00;&#x7BC7;&#x6587;&#x7AE0;&#x4E2D;(&#x7528;socket&#x5199;&#x4E00;&#x4E2A;Python&#x670D;&#x52A1;&#x5668;)&#xFF0C;&#x6211;&#x4F7F;&#x7528;socket&#x63A5;&#x53E3;&#xFF0C;&#x5236;&#x4F5C;&#x4E86;&#x4E00;&#x4E2A;&#x5904;&#x7406;HTTP&#x8BF7;&#x6C42;&#x7684;Python&#x670D;&#x52A1;&#x5668;&#x3002;&#x4EFB;&#x4F55;&#x4E00;&#x53F0;&#x88C5;&#x6709;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x548C;Python&#x89E3;&#x91CA;&#x5668;&#x7684;&#x8BA1;&#x7B97;&#x673A;&#xFF0C;&#x90FD;&#x53EF;&#x4EE5;&#x4F5C;&#x4E3A;HTTP&#x670D;&#x52A1;&#x5668;&#x4F7F;&#x7528;&#x3002;&#x6211;&#x5C06;&#x5728;&#x8FD9;&#x91CC;&#x4E0D;&#x65AD;&#x6539;&#x5199;&#x4E0A;&#x4E00;&#x7BC7;&#x6587;&#x7AE0;&#x4E2D;&#x7684;&#x7A0B;&#x5E8F;&#xFF0C;&#x5F15;&#x5165;&#x66F4;&#x9AD8;&#x7EA7;&#x7684;Python&#x5305;&#xFF0C;&#x4EE5;&#x5199;&#x51FA;&#x66F4;&#x6210;&#x719F;&#x7684;Python&#x670D;&#x52A1;&#x5668;&#x3002;</p>
<h2 id="&#x652F;&#x6301;post">&#x652F;&#x6301;POST</h2>
<p>&#x6211;&#x9996;&#x5148;&#x589E;&#x52A0;&#x8BE5;&#x670D;&#x52A1;&#x5668;&#x7684;&#x529F;&#x80FD;&#x3002;&#x8FD9;&#x91CC;&#x589E;&#x6DFB;&#x4E86;&#x8868;&#x683C;&#xFF0C;&#x4EE5;&#x53CA;&#x5904;&#x7406;&#x8868;&#x683C;&#x63D0;&#x4EA4;&#x6570;&#x636E;&#x7684;&quot;POST&quot;&#x65B9;&#x6CD5;&#x3002;&#x5982;&#x679C;&#x4F60;&#x5DF2;&#x7ECF;&#x8BFB;&#x8FC7;&#x7528;socket&#x5199;&#x4E00;&#x4E2A;Python&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x4F1A;&#x53D1;&#x73B0;&#x8FD9;&#x91CC;&#x53EA;&#x662F;&#x589E;&#x52A0;&#x5F88;&#x5C11;&#x7684;&#x4E00;&#x70B9;&#x5185;&#x5BB9;&#x3002;</p>
<p>&#x539F;&#x59CB;&#x7A0B;&#x5E8F;:</p>
<pre><code class="lang-python"><span class="hljs-comment"># A messy HTTP server based on TCP socket </span>

<span class="hljs-keyword">import</span> socket

<span class="hljs-comment"># Address</span>
HOST = <span class="hljs-string">&apos;&apos;</span>
PORT = <span class="hljs-number">8000</span>

text_content = <span class="hljs-string">&apos;&apos;&apos;HTTP/1.x 200 OK  
Content-Type: text/html

&lt;head&gt;
&lt;title&gt;WOW&lt;/title&gt;
&lt;/head&gt;
&lt;html&gt;
&lt;p&gt;Wow, Python Server&lt;/p&gt;
&lt;IMG src=&quot;test.jpg&quot;/&gt;
&lt;form name=&quot;input&quot; action=&quot;/&quot; method=&quot;post&quot;&gt;
First name:&lt;input type=&quot;text&quot; name=&quot;firstname&quot;&gt;&lt;br&gt;
&lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
&lt;/form&gt; 
&lt;/html&gt;
&apos;&apos;&apos;</span>

f = open(<span class="hljs-string">&apos;test.jpg&apos;</span>,<span class="hljs-string">&apos;rb&apos;</span>)
pic_content = <span class="hljs-string">&apos;&apos;&apos;HTTP/1.x 200 OK  
Content-Type: image/jpg

&apos;&apos;&apos;</span>
pic_content = pic_content + f.read()

<span class="hljs-comment"># Configure socket</span>
s    = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))

<span class="hljs-comment"># Serve forever</span>
<span class="hljs-keyword">while</span> <span class="hljs-keyword">True</span>:
    s.listen(<span class="hljs-number">3</span>)
    conn, addr = s.accept()                    
    request    = conn.recv(<span class="hljs-number">1024</span>)         <span class="hljs-comment"># 1024 is the receiving buffer size</span>
    method     = request.split(<span class="hljs-string">&apos; &apos;</span>)[<span class="hljs-number">0</span>]
    src        = request.split(<span class="hljs-string">&apos; &apos;</span>)[<span class="hljs-number">1</span>]

    <span class="hljs-keyword">print</span> <span class="hljs-string">&apos;Connected by&apos;</span>, addr
    <span class="hljs-keyword">print</span> <span class="hljs-string">&apos;Request is:&apos;</span>, request

    <span class="hljs-comment"># if GET method request</span>
    <span class="hljs-keyword">if</span> method == <span class="hljs-string">&apos;GET&apos;</span>:
        <span class="hljs-comment"># if ULR is /test.jpg</span>
        <span class="hljs-keyword">if</span> src == <span class="hljs-string">&apos;/test.jpg&apos;</span>:
            content = pic_content
        <span class="hljs-keyword">else</span>: content = text_content
        <span class="hljs-comment"># send message</span>
        conn.sendall(content)
    <span class="hljs-comment"># if POST method request</span>
    <span class="hljs-keyword">if</span> method == <span class="hljs-string">&apos;POST&apos;</span>:
        form = request.split(<span class="hljs-string">&apos;\r\n&apos;</span>)
        idx = form.index(<span class="hljs-string">&apos;&apos;</span>)             <span class="hljs-comment"># Find the empty line</span>
        entry = form[idx:]               <span class="hljs-comment"># Main content of the request</span>

        value = entry[<span class="hljs-number">-1</span>].split(<span class="hljs-string">&apos;=&apos;</span>)[<span class="hljs-number">-1</span>]
        conn.sendall(text_content + <span class="hljs-string">&apos;\n &lt;p&gt;&apos;</span> + value + <span class="hljs-string">&apos;&lt;/p&gt;&apos;</span>)
        <span class="hljs-comment">###### </span>
        <span class="hljs-comment"># More operations, such as put the form into database</span>
        <span class="hljs-comment"># ...</span>
        <span class="hljs-comment">###### </span>
    <span class="hljs-comment"># close connection</span>
    conn.close()
</code></pre>
<p>&#x670D;&#x52A1;&#x5668;&#x8FDB;&#x884C;&#x7684;&#x64CD;&#x4F5C;&#x5F88;&#x7B80;&#x5355;&#xFF0C;&#x5373;&#x4ECE;POST&#x8BF7;&#x6C42;&#x4E2D;&#x63D0;&#x53D6;&#x6570;&#x636E;&#xFF0C;&#x518D;&#x663E;&#x793A;&#x5728;&#x5C4F;&#x5E55;&#x4E0A;&#x3002;</p>
<p>&#x8FD0;&#x884C;&#x4E0A;&#x9762;Python&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x50CF;&#x4E0A;&#x4E00;&#x7BC7;&#x6587;&#x7AE0;&#x90A3;&#x6837;&#xFF0C;&#x4F7F;&#x7528;&#x4E00;&#x4E2A;&#x6D4F;&#x89C8;&#x5668;&#x6253;&#x5F00;&#x3002;
<img src="2012103117264627.png" alt=""></p>
<p>&#x9875;&#x9762;&#x65B0;&#x589E;&#x4E86;&#x8868;&#x683C;&#x548C;&#x63D0;&#x4EA4;(submit)&#x6309;&#x94AE;&#x3002;&#x5728;&#x8868;&#x683C;&#x4E2D;&#x8F93;&#x5165;aa&#x5E76;&#x63D0;&#x4EA4;&#xFF0C;&#x9875;&#x9762;&#x663E;&#x793A;&#x51FA;aa&#x3002;</p>
<p>&#x6211;&#x4E0B;&#x4E00;&#x6B65;&#x8981;&#x7528;&#x4E00;&#x4E9B;&#x9AD8;&#x7EA7;&#x5305;&#xFF0C;&#x6765;&#x7B80;&#x5316;&#x4E4B;&#x524D;&#x7684;&#x4EE3;&#x7801;&#x3002;</p>
<h2 id="&#x4F7F;&#x7528;socketserver">&#x4F7F;&#x7528;SocketServer</h2>
<p>&#x9996;&#x5148;&#x4F7F;&#x7528;SocketServer&#x5305;&#x6765;&#x65B9;&#x4FBF;&#x7684;&#x67B6;&#x8BBE;&#x670D;&#x52A1;&#x5668;&#x3002;&#x5728;&#x4E0A;&#x9762;&#x4F7F;&#x7528;socket&#x7684;&#x8FC7;&#x7A0B;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x5148;&#x8BBE;&#x7F6E;&#x4E86;socket&#x7684;&#x7C7B;&#x578B;&#xFF0C;&#x7136;&#x540E;&#x4F9D;&#x6B21;&#x8C03;&#x7528;bind(),listen(),accept()&#xFF0C;&#x6700;&#x540E;&#x4F7F;&#x7528;while&#x5FAA;&#x73AF;&#x6765;&#x8BA9;&#x670D;&#x52A1;&#x5668;&#x4E0D;&#x65AD;&#x7684;&#x63A5;&#x53D7;&#x8BF7;&#x6C42;&#x3002;&#x4E0A;&#x9762;&#x7684;&#x8FD9;&#x4E9B;&#x6B65;&#x9AA4;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;SocketServer&#x5305;&#x6765;&#x7B80;&#x5316;&#x3002;</p>
<p>SocketServer:</p>
<pre><code class="lang-python"><span class="hljs-comment"># use TCPServer</span>

<span class="hljs-keyword">import</span> SocketServer

HOST = <span class="hljs-string">&apos;&apos;</span>
PORT = <span class="hljs-number">8000</span>

text_content = <span class="hljs-string">&apos;&apos;&apos;HTTP/1.x 200 OK  
Content-Type: text/html

&lt;head&gt;
&lt;title&gt;WOW&lt;/title&gt;
&lt;/head&gt;
&lt;html&gt;
&lt;p&gt;Wow, Python Server&lt;/p&gt;
&lt;IMG src=&quot;test.jpg&quot;/&gt;
&lt;form name=&quot;input&quot; action=&quot;/&quot; method=&quot;post&quot;&gt;
First name:&lt;input type=&quot;text&quot; name=&quot;firstname&quot;&gt;&lt;br&gt;
&lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
&lt;/form&gt; 
&lt;/html&gt;
&apos;&apos;&apos;</span>

f = open(<span class="hljs-string">&apos;test.jpg&apos;</span>,<span class="hljs-string">&apos;rb&apos;</span>)
pic_content = <span class="hljs-string">&apos;&apos;&apos;HTTP/1.x 200 OK  
Content-Type: image/jpg

&apos;&apos;&apos;</span>
pic_content = pic_content + f.read()

<span class="hljs-comment"># This class defines response to each request</span>
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyTCPHandler</span><span class="hljs-params">(SocketServer.BaseRequestHandler)</span>:</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">handle</span><span class="hljs-params">(self)</span>:</span>
        <span class="hljs-comment"># self.request is the TCP socket connected to the client</span>
        request = self.request.recv(<span class="hljs-number">1024</span>)

        <span class="hljs-keyword">print</span> <span class="hljs-string">&apos;Connected by&apos;</span>,self.client_address[<span class="hljs-number">0</span>]
        <span class="hljs-keyword">print</span> <span class="hljs-string">&apos;Request is&apos;</span>, request

        method     = request.split(<span class="hljs-string">&apos; &apos;</span>)[<span class="hljs-number">0</span>]
        src        = request.split(<span class="hljs-string">&apos; &apos;</span>)[<span class="hljs-number">1</span>]

        <span class="hljs-keyword">if</span> method == <span class="hljs-string">&apos;GET&apos;</span>:
            <span class="hljs-keyword">if</span> src == <span class="hljs-string">&apos;/test.jpg&apos;</span>:
                content = pic_content
            <span class="hljs-keyword">else</span>: content = text_content
            self.request.sendall(content)

        <span class="hljs-keyword">if</span> method == <span class="hljs-string">&apos;POST&apos;</span>:
            form = request.split(<span class="hljs-string">&apos;\r\n&apos;</span>)
            idx = form.index(<span class="hljs-string">&apos;&apos;</span>)             <span class="hljs-comment"># Find the empty line</span>
            entry = form[idx:]               <span class="hljs-comment"># Main content of the request</span>

            value = entry[<span class="hljs-number">-1</span>].split(<span class="hljs-string">&apos;=&apos;</span>)[<span class="hljs-number">-1</span>]
            self.request.sendall(text_content + <span class="hljs-string">&apos;\n &lt;p&gt;&apos;</span> + value + <span class="hljs-string">&apos;&lt;/p&gt;&apos;</span>)
            <span class="hljs-comment">###### </span>
            <span class="hljs-comment"># More operations, such as put the form into database</span>
            <span class="hljs-comment"># ...</span>
            <span class="hljs-comment">###### </span>


<span class="hljs-comment"># Create the server</span>
server = SocketServer.TCPServer((HOST, PORT), MyTCPHandler)
<span class="hljs-comment"># Start the server, and work forever</span>
server.serve_forever()
</code></pre>
<p>&#x6211;&#x5EFA;&#x7ACB;&#x4E86;&#x4E00;&#x4E2A;TCPServer&#x5BF9;&#x8C61;&#xFF0C;&#x5373;&#x4E00;&#x4E2A;&#x4F7F;&#x7528;TCP socket&#x7684;&#x670D;&#x52A1;&#x5668;&#x3002;&#x5728;&#x5EFA;&#x7ACB;TCPServe&#x7684;&#x540C;&#x65F6;&#xFF0C;&#x8BBE;&#x7F6E;&#x8BE5;&#x670D;&#x52A1;&#x5668;&#x7684;IP&#x5730;&#x5740;&#x548C;&#x7AEF;&#x53E3;&#x3002;&#x4F7F;&#x7528;server_forever()&#x65B9;&#x6CD5;&#x6765;&#x8BA9;&#x670D;&#x52A1;&#x5668;&#x4E0D;&#x65AD;&#x5DE5;&#x4F5C;(&#x5C31;&#x50CF;&#x539F;&#x59CB;&#x7A0B;&#x5E8F;&#x4E2D;&#x7684;while&#x5FAA;&#x73AF;&#x4E00;&#x6837;)&#x3002;</p>
<p>&#x6211;&#x4EEC;&#x4F20;&#x9012;&#x7ED9;TCPServer&#x4E00;&#x4E2A;MyTCPHandler&#x7C7B;&#x3002;&#x8FD9;&#x4E2A;&#x7C7B;&#x5B9A;&#x4E49;&#x4E86;&#x5982;&#x4F55;&#x64CD;&#x4F5C;socket&#x3002;MyTCPHandler&#x7EE7;&#x627F;&#x81EA;BaseRequestHandler&#x3002;&#x6539;&#x5199;handler()&#x65B9;&#x6CD5;&#xFF0C;&#x6765;&#x5177;&#x4F53;&#x89C4;&#x5B9A;&#x4E0D;&#x540C;&#x60C5;&#x51B5;&#x4E0B;&#x670D;&#x52A1;&#x5668;&#x7684;&#x64CD;&#x4F5C;&#x3002;</p>
<p>&#x5728;handler()&#x4E2D;&#xFF0C;&#x901A;&#x8FC7;self.request&#x6765;&#x67E5;&#x8BE2;&#x901A;&#x8FC7;socket&#x8FDB;&#x5165;&#x670D;&#x52A1;&#x5668;&#x7684;&#x8BF7;&#x6C42; (&#x6B63;&#x5982;&#x6211;&#x4EEC;&#x5728;handler()&#x4E2D;&#x5BF9;socket&#x8FDB;&#x884C;recv()&#x548C;sendall()&#x64CD;&#x4F5C;)&#xFF0C;&#x8FD8;&#x4F7F;&#x7528;self.address&#x6765;&#x5F15;&#x7528;socket&#x7684;&#x5BA2;&#x6237;&#x7AEF;&#x5730;&#x5740;&#x3002;</p>
<p>&#x7ECF;&#x8FC7;SocketServer&#x7684;&#x6539;&#x9020;&#x4E4B;&#x540E;&#xFF0C;&#x4EE3;&#x7801;&#x8FD8;&#x662F;&#x4E0D;&#x591F;&#x7B80;&#x5355;&#x3002; &#x6211;&#x4EEC;&#x4E0A;&#x9762;&#x7684;&#x901A;&#x4FE1;&#x57FA;&#x4E8E;TCP&#x534F;&#x8BAE;&#xFF0C;&#x800C;&#x4E0D;&#x662F;HTTP&#x534F;&#x8BAE;&#x3002;&#x56E0;&#x6B64;&#xFF0C;&#x6211;&#x4EEC;&#x5FC5;&#x987B;&#x624B;&#x52A8;&#x7684;&#x89E3;&#x6790;HTTP&#x534F;&#x8BAE;&#x3002;&#x6211;&#x4EEC;&#x5C06;&#x5EFA;&#x7ACB;&#x57FA;&#x4E8E;HTTP&#x534F;&#x8BAE;&#x7684;&#x670D;&#x52A1;&#x5668;&#x3002;</p>
<h2 id="simplehttpserver-&#x4F7F;&#x7528;&#x9759;&#x6001;&#x6587;&#x4EF6;&#x6765;&#x56DE;&#x5E94;&#x8BF7;&#x6C42;">SimpleHTTPServer: &#x4F7F;&#x7528;&#x9759;&#x6001;&#x6587;&#x4EF6;&#x6765;&#x56DE;&#x5E94;&#x8BF7;&#x6C42;</h2>
<p>HTTP&#x534F;&#x8BAE;&#x57FA;&#x4E8E;TCP&#x534F;&#x8BAE;&#xFF0C;&#x4F46;&#x589E;&#x52A0;&#x4E86;&#x66F4;&#x591A;&#x7684;&#x89C4;&#x8303;&#x3002;&#x8FD9;&#x4E9B;&#x89C4;&#x8303;&#xFF0C;&#x867D;&#x7136;&#x9650;&#x5236;&#x4E86;TCP&#x534F;&#x8BAE;&#x7684;&#x529F;&#x80FD;&#xFF0C;&#x4F46;&#x5927;&#x5927;&#x63D0;&#x9AD8;&#x4E86;&#x4FE1;&#x606F;&#x5C01;&#x88C5;&#x548C;&#x63D0;&#x53D6;&#x7684;&#x65B9;&#x4FBF;&#x7A0B;&#x5EA6;&#x3002;</p>
<p>&#x5BF9;&#x4E8E;&#x4E00;&#x4E2A;HTTP&#x8BF7;&#x6C42;(request)&#x6765;&#x8BF4;&#xFF0C;&#x5B83;&#x5305;&#x542B;&#x6709;&#x4E24;&#x4E2A;&#x91CD;&#x8981;&#x4FE1;&#x606F;&#xFF1A;&#x8BF7;&#x6C42;&#x65B9;&#x6CD5;&#x548C;URL&#x3002;</p>
<p>&#x8BF7;&#x6C42;&#x65B9;&#x6CD5;(request method)       URL                &#x64CD;&#x4F5C;</p>
<p>GET                           /                  &#x53D1;&#x9001;text_content</p>
<p>GET                           /text.jpg          &#x53D1;&#x9001;pic_content</p>
<p>POST                          /                  &#x5206;&#x6790;request&#x4E3B;&#x4F53;&#x4E2D;&#x5305;&#x542B;&#x7684;value(&#x5B9E;&#x9645;&#x4E0A;&#x662F;&#x6211;&#x4EEC;&#x586B;&#x5165;&#x8868;&#x683C;&#x7684;&#x5185;&#x5BB9;); &#x53D1;&#x9001;text_content&#x548C;value</p>
<p>&#x6839;&#x636E;&#x8BF7;&#x6C42;&#x65B9;&#x6CD5;&#x548C;URL&#x7684;&#x4E0D;&#x540C;&#xFF0C;&#x4E00;&#x4E2A;&#x5927;&#x578B;&#x7684;HTTP&#x670D;&#x52A1;&#x5668;&#x53EF;&#x4EE5;&#x5E94;&#x4ED8;&#x6210;&#x5343;&#x4E0A;&#x4E07;&#x79CD;&#x4E0D;&#x540C;&#x7684;&#x8BF7;&#x6C42;&#x3002;&#x5728;Python&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;SimpleHTTPServer&#x5305;&#x548C;CGIHTTPServer&#x5305;&#x6765;&#x89C4;&#x5B9A;&#x9488;&#x5BF9;&#x4E0D;&#x540C;&#x8BF7;&#x6C42;&#x7684;&#x64CD;&#x4F5C;&#x3002;&#x5176;&#x4E2D;&#xFF0C;SimpleHTTPServer&#x53EF;&#x4EE5;&#x7528;&#x4E8E;&#x5904;&#x7406;GET&#x65B9;&#x6CD5;&#x548C;HEAD&#x65B9;&#x6CD5;&#x7684;&#x8BF7;&#x6C42;&#x3002;&#x5B83;&#x8BFB;&#x53D6;request&#x4E2D;&#x7684;URL&#x5730;&#x5740;&#xFF0C;&#x627E;&#x5230;&#x5BF9;&#x5E94;&#x7684;&#x9759;&#x6001;&#x6587;&#x4EF6;&#xFF0C;&#x5206;&#x6790;&#x6587;&#x4EF6;&#x7C7B;&#x578B;&#xFF0C;&#x7528;HTTP&#x534F;&#x8BAE;&#x5C06;&#x6587;&#x4EF6;&#x53D1;&#x9001;&#x7ED9;&#x5BA2;&#x6237;&#x3002;</p>
<p><img src="2012103116160628.jpg" alt=""></p>
<p>SimpleHTTPServer</p>
<p>&#x6211;&#x4EEC;&#x5C06;text_content&#x653E;&#x7F6E;&#x5728;index.html&#x4E2D;&#xFF0C;&#x5E76;&#x5355;&#x72EC;&#x5B58;&#x50A8;text.jpg&#x6587;&#x4EF6;&#x3002;&#x5982;&#x679C;URL&#x6307;&#x5411;index_html&#x7684;&#x6BCD;&#x6587;&#x4EF6;&#x5939;&#x65F6;&#xFF0C;SimpleHTTPServer&#x4F1A;&#x8BFB;&#x53D6;&#x8BE5;&#x6587;&#x4EF6;&#x5939;&#x4E0B;&#x7684;index.html&#x6587;&#x4EF6;&#x3002;</p>
<p>&#x6211;&#x5728;&#x5F53;&#x524D;&#x76EE;&#x5F55;&#x4E0B;&#x751F;&#x6210;index.html&#x6587;&#x4EF6;:</p>
<pre><code class="lang-python">&lt;head&gt;
&lt;title&gt;WOW&lt;/title&gt;
&lt;/head&gt;
&lt;html&gt;
&lt;p&gt;Wow, Python Server&lt;/p&gt;
&lt;IMG src=&quot;test.jpg&quot;/&gt;
&lt;form name=&quot;input&quot; action=&quot;/&quot; method=&quot;post&quot;&gt;
First name:&lt;input type=&quot;text&quot; name=&quot;firstname&quot;&gt;&lt;br&gt;
&lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
&lt;/form&gt;
&lt;/html&gt;
</code></pre>
<p>&#x6539;&#x5199;Python&#x670D;&#x52A1;&#x5668;&#x7A0B;&#x5E8F;&#x3002;&#x4F7F;&#x7528;SimpleHTTPServer&#x5305;&#x4E2D;&#x552F;&#x4E00;&#x7684;&#x7C7B;SimpleHTTPRequestHandler:</p>
<pre><code class="lang-python"><span class="hljs-comment"># Simple HTTPsERVER</span>

<span class="hljs-keyword">import</span> SocketServer
<span class="hljs-keyword">import</span> SimpleHTTPServer

HOST = <span class="hljs-string">&apos;&apos;</span>
PORT = <span class="hljs-number">8000</span>

<span class="hljs-comment"># Create the server, SimpleHTTPRequestHander is pre-defined handler in SimpleHTTPServer package</span>
server = SocketServer.TCPServer((HOST, PORT), SimpleHTTPServer.SimpleHTTPRequestHandler)
<span class="hljs-comment"># Start the server</span>
server.serve_forever()
</code></pre>
<p>&#x8FD9;&#x91CC;&#x7684;&#x7A0B;&#x5E8F;&#x4E0D;&#x80FD;&#x5904;&#x7406;POST&#x8BF7;&#x6C42;&#x3002;&#x6211;&#x4F1A;&#x5728;&#x540E;&#x9762;&#x4F7F;&#x7528;CGI&#x6765;&#x5F25;&#x8865;&#x8FD9;&#x4E2A;&#x7F3A;&#x9677;&#x3002;&#x503C;&#x5F97;&#x6CE8;&#x610F;&#x7684;&#x662F;&#xFF0C;Python&#x670D;&#x52A1;&#x5668;&#x7A0B;&#x5E8F;&#x53D8;&#x5F97;&#x975E;&#x5E38;&#x7B80;&#x5355;&#x3002;&#x5C06;&#x5185;&#x5BB9;&#x5B58;&#x653E;&#x4E8E;&#x9759;&#x6001;&#x6587;&#x4EF6;&#xFF0C;&#x5E76;&#x6839;&#x636E;URL&#x4E3A;&#x5BA2;&#x6237;&#x7AEF;&#x63D0;&#x4F9B;&#x5185;&#x5BB9;&#xFF0C;&#x8FD9;&#x8BA9;&#x5185;&#x5BB9;&#x548C;&#x670D;&#x52A1;&#x5668;&#x903B;&#x8F91;&#x5206;&#x79BB;&#x3002;&#x6BCF;&#x6B21;&#x66F4;&#x65B0;&#x5185;&#x5BB9;&#x65F6;&#xFF0C;&#x6211;&#x53EF;&#x4EE5;&#x53EA;&#x4FEE;&#x6539;&#x9759;&#x6001;&#x6587;&#x4EF6;&#xFF0C;&#x800C;&#x4E0D;&#x7528;&#x505C;&#x6B62;&#x6574;&#x4E2A;Python&#x670D;&#x52A1;&#x5668;&#x3002;</p>
<p>&#x8FD9;&#x4E9B;&#x6539;&#x8FDB;&#x4E5F;&#x4ED8;&#x51FA;&#x4EE3;&#x4EF7;&#x3002;&#x5728;&#x539F;&#x59CB;&#x7A0B;&#x5E8F;&#x4E2D;&#xFF0C;request&#x4E2D;&#x7684;URL&#x53EA;&#x5177;&#x6709;&#x6307;&#x5BFC;&#x610F;&#x4E49;&#xFF0C;&#x6211;&#x53EF;&#x4EE5;&#x89C4;&#x5B9A;&#x4EFB;&#x610F;&#x7684;&#x64CD;&#x4F5C;&#x3002;&#x5728;SimpleHTTPServer&#x4E2D;&#xFF0C;&#x64CD;&#x4F5C;&#x4E0E;URL&#x7684;&#x6307;&#x5411;&#x5BC6;&#x5207;&#x76F8;&#x5173;&#x3002;&#x6211;&#x7528;&#x81EA;&#x7531;&#x5EA6;&#xFF0C;&#x6362;&#x6765;&#x4E86;&#x66F4;&#x52A0;&#x7B80;&#x6D01;&#x7684;&#x7A0B;&#x5E8F;&#x3002;</p>
<h2 id="cgihttpserver&#xFF1A;&#x4F7F;&#x7528;&#x9759;&#x6001;&#x6587;&#x4EF6;&#x6216;&#x8005;cgi&#x6765;&#x56DE;&#x5E94;&#x8BF7;&#x6C42;">CGIHTTPServer&#xFF1A;&#x4F7F;&#x7528;&#x9759;&#x6001;&#x6587;&#x4EF6;&#x6216;&#x8005;CGI&#x6765;&#x56DE;&#x5E94;&#x8BF7;&#x6C42;</h2>
<p>CGIHTTPServer&#x5305;&#x4E2D;&#x7684;CGIHTTPRequestHandler&#x7C7B;&#x7EE7;&#x627F;&#x81EA;SimpleHTTPRequestHandler&#x7C7B;&#xFF0C;&#x6240;&#x4EE5;&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x4EE3;&#x66FF;&#x4E0A;&#x9762;&#x7684;&#x4F8B;&#x5B50;&#xFF0C;&#x6765;&#x63D0;&#x4F9B;&#x9759;&#x6001;&#x6587;&#x4EF6;&#x7684;&#x670D;&#x52A1;&#x3002;&#x6B64;&#x5916;&#xFF0C;CGIHTTPRequestHandler&#x7C7B;&#x8FD8;&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x8FD0;&#x884C;CGI&#x811A;&#x672C;&#x3002;</p>
<p><img src="2012103116413014.jpg" alt=""></p>
<center>CGIHTTPServer</center>



<p>&#x5148;&#x770B;&#x770B;&#x4EC0;&#x4E48;&#x662F;CGI (Common Gateway Interface)&#x3002;CGI&#x662F;&#x670D;&#x52A1;&#x5668;&#x548C;&#x5E94;&#x7528;&#x811A;&#x672C;&#x4E4B;&#x95F4;&#x7684;&#x4E00;&#x5957;&#x63A5;&#x53E3;&#x6807;&#x51C6;&#x3002;&#x5B83;&#x7684;&#x529F;&#x80FD;&#x662F;&#x8BA9;&#x670D;&#x52A1;&#x5668;&#x7A0B;&#x5E8F;&#x8FD0;&#x884C;&#x811A;&#x672C;&#x7A0B;&#x5E8F;&#xFF0C;&#x5C06;&#x7A0B;&#x5E8F;&#x7684;&#x8F93;&#x51FA;&#x4F5C;&#x4E3A;response&#x53D1;&#x9001;&#x7ED9;&#x5BA2;&#x6237;&#x3002;&#x603B;&#x4F53;&#x7684;&#x6548;&#x679C;&#xFF0C;&#x662F;&#x5141;&#x8BB8;&#x670D;&#x52A1;&#x5668;&#x52A8;&#x6001;&#x7684;&#x751F;&#x6210;&#x56DE;&#x590D;&#x5185;&#x5BB9;&#xFF0C;&#x800C;&#x4E0D;&#x5FC5;&#x5C40;&#x9650;&#x4E8E;&#x9759;&#x6001;&#x6587;&#x4EF6;&#x3002;</p>
<p>&#x652F;&#x6301;CGI&#x7684;&#x670D;&#x52A1;&#x5668;&#x7A0B;&#x63A5;&#x6536;&#x5230;&#x5BA2;&#x6237;&#x7684;&#x8BF7;&#x6C42;&#xFF0C;&#x6839;&#x636E;&#x8BF7;&#x6C42;&#x4E2D;&#x7684;URL&#xFF0C;&#x8FD0;&#x884C;&#x5BF9;&#x5E94;&#x7684;&#x811A;&#x672C;&#x6587;&#x4EF6;&#x3002;&#x670D;&#x52A1;&#x5668;&#x4F1A;&#x5C06;HTTP&#x8BF7;&#x6C42;&#x7684;&#x4FE1;&#x606F;&#x548C;socket&#x4FE1;&#x606F;&#x4F20;&#x9012;&#x7ED9;&#x811A;&#x672C;&#x6587;&#x4EF6;&#xFF0C;&#x5E76;&#x7B49;&#x5F85;&#x811A;&#x672C;&#x7684;&#x8F93;&#x51FA;&#x3002;&#x811A;&#x672C;&#x7684;&#x8F93;&#x51FA;&#x5C01;&#x88C5;&#x6210;&#x5408;&#x6CD5;&#x7684;HTTP&#x56DE;&#x590D;&#xFF0C;&#x53D1;&#x9001;&#x7ED9;&#x5BA2;&#x6237;&#x3002;CGI&#x53EF;&#x4EE5;&#x5145;&#x5206;&#x53D1;&#x6325;&#x670D;&#x52A1;&#x5668;&#x7684;&#x53EF;&#x7F16;&#x7A0B;&#x6027;&#xFF0C;&#x8BA9;&#x670D;&#x52A1;&#x5668;&#x53D8;&#x5F97;&#x201C;&#x66F4;&#x806A;&#x660E;&#x201D;&#x3002;</p>
<p>&#x670D;&#x52A1;&#x5668;&#x548C;CGI&#x811A;&#x672C;&#x4E4B;&#x95F4;&#x7684;&#x901A;&#x4FE1;&#x8981;&#x7B26;&#x5408;CGI&#x6807;&#x51C6;&#x3002;CGI&#x7684;&#x5B9E;&#x73B0;&#x65B9;&#x5F0F;&#x6709;&#x5F88;&#x591A;&#xFF0C;&#x6BD4;&#x5982;&#x8BF4;&#x4F7F;&#x7528;Apache&#x670D;&#x52A1;&#x5668;&#x4E0E;Perl&#x5199;&#x7684;CGI&#x811A;&#x672C;&#xFF0C;&#x6216;&#x8005;Python&#x670D;&#x52A1;&#x5668;&#x4E0E;shell&#x5199;&#x7684;CGI&#x811A;&#x672C;&#x3002;</p>
<p>&#x4E3A;&#x4E86;&#x4F7F;&#x7528;CGI&#xFF0C;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x4F7F;&#x7528;BaseHTTPServer&#x5305;&#x4E2D;&#x7684;HTTPServer&#x7C7B;&#x6765;&#x6784;&#x5EFA;&#x670D;&#x52A1;&#x5668;&#x3002;Python&#x670D;&#x52A1;&#x5668;&#x7684;&#x6539;&#x52A8;&#x5F88;&#x7B80;&#x5355;&#x3002;</p>
<p>CGIHTTPServer:</p>
<pre><code class="lang-python"><span class="hljs-comment"># A messy HTTP server based on TCP socket </span>

<span class="hljs-keyword">import</span> BaseHTTPServer
<span class="hljs-keyword">import</span> CGIHTTPServer

HOST = <span class="hljs-string">&apos;&apos;</span>
PORT = <span class="hljs-number">8000</span>

<span class="hljs-comment"># Create the server, CGIHTTPRequestHandler is pre-defined handler</span>
server = BaseHTTPServer.HTTPServer((HOST, PORT), CGIHTTPServer.CGIHTTPRequestHandler)
<span class="hljs-comment"># Start the server</span>
server.serve_forever()
</code></pre>
<p>CGIHTTPRequestHandler&#x9ED8;&#x8BA4;&#x5F53;&#x524D;&#x76EE;&#x5F55;&#x4E0B;&#x7684;cgi-bin&#x548C;ht-bin&#x6587;&#x4EF6;&#x5939;&#x4E2D;&#x7684;&#x6587;&#x4EF6;&#x4E3A;CGI&#x811A;&#x672C;&#xFF0C;&#x800C;&#x5B58;&#x653E;&#x4E8E;&#x5176;&#x4ED6;&#x5730;&#x65B9;&#x7684;&#x6587;&#x4EF6;&#x88AB;&#x8BA4;&#x4E3A;&#x662F;&#x9759;&#x6001;&#x6587;&#x4EF6;&#x3002;&#x56E0;&#x6B64;&#xFF0C;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x4FEE;&#x6539;&#x4E00;&#x4E0B;index.html&#xFF0C;&#x5C06;&#x5176;&#x4E2D;form&#x5143;&#x7D20;&#x6307;&#x5411;&#x7684;action&#x6539;&#x4E3A;cgi-bin/post.py&#x3002;</p>
<pre><code class="lang-python">&lt;head&gt;
&lt;title&gt;WOW&lt;/title&gt;
&lt;/head&gt;
&lt;html&gt;
&lt;p&gt;Wow, Python Server&lt;/p&gt;
&lt;IMG src=&quot;test.jpg&quot;/&gt;
&lt;form name=&quot;input&quot; action=&quot;cgi-bin/post.py&quot; method=&quot;post&quot;&gt;
First name:&lt;input type=&quot;text&quot; name=&quot;firstname&quot;&gt;&lt;br&gt;
&lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
&lt;/form&gt;
&lt;/html&gt;
</code></pre>
<p>&#x6211;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;cgi-bin&#x7684;&#x6587;&#x4EF6;&#x5939;&#xFF0C;&#x5E76;&#x5728;cgi-bin&#x4E2D;&#x653E;&#x5165;&#x5982;&#x4E0B;post.py&#x6587;&#x4EF6;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x6211;&#x4EEC;&#x7684;CGI&#x811A;&#x672C;&#xFF1A;</p>
<pre><code class="lang-python"><span class="hljs-comment"># !/usr/bin/env python</span>
<span class="hljs-keyword">import</span> cgi
form = cgi.FieldStorage()

<span class="hljs-comment"># Output to stdout, CGIHttpServer will take this as response to the client</span>
<span class="hljs-keyword">print</span> <span class="hljs-string">&quot;Content-Type: text/html&quot;</span>     <span class="hljs-comment"># HTML is following</span>
<span class="hljs-keyword">print</span>                               <span class="hljs-comment"># blank line, end of headers</span>
<span class="hljs-keyword">print</span> <span class="hljs-string">&quot;&lt;p&gt;Hello world!&lt;/p&gt;&quot;</span>         <span class="hljs-comment"># Start of content</span>
<span class="hljs-keyword">print</span> <span class="hljs-string">&quot;&lt;p&gt;&quot;</span> +  repr(form[<span class="hljs-string">&apos;firstname&apos;</span>]) + <span class="hljs-string">&quot;&lt;/p&gt;&quot;</span>
</code></pre>
<p>(post.py&#x9700;&#x8981;&#x6709;&#x6267;&#x884C;&#x6743;&#x9650;&#xFF0C;&#x89C1;&#x8BC4;&#x8BBA;&#x533A;)</p>
<p>&#x7B2C;&#x4E00;&#x884C;&#x8BF4;&#x660E;&#x4E86;&#x811A;&#x672C;&#x6240;&#x4F7F;&#x7528;&#x7684;&#x8BED;&#x8A00;&#xFF0C;&#x5373;Python&#x3002; cgi&#x5305;&#x7528;&#x4E8E;&#x63D0;&#x53D6;&#x8BF7;&#x6C42;&#x4E2D;&#x5305;&#x542B;&#x7684;&#x8868;&#x683C;&#x4FE1;&#x606F;&#x3002;&#x811A;&#x672C;&#x53EA;&#x8D1F;&#x8D23;&#x5C06;&#x6240;&#x6709;&#x7684;&#x7ED3;&#x679C;&#x8F93;&#x51FA;&#x5230;&#x6807;&#x51C6;&#x8F93;&#x51FA;(&#x4F7F;&#x7528;print)&#x3002;CGIHTTPRequestHandler&#x4F1A;&#x6536;&#x96C6;&#x8FD9;&#x4E9B;&#x8F93;&#x51FA;&#xFF0C;&#x5C01;&#x88C5;&#x6210;HTTP&#x56DE;&#x590D;&#xFF0C;&#x4F20;&#x9001;&#x7ED9;&#x5BA2;&#x6237;&#x7AEF;&#x3002;</p>
<p>&#x5BF9;&#x4E8E;POST&#x65B9;&#x6CD5;&#x7684;&#x8BF7;&#x6C42;&#xFF0C;&#x5B83;&#x7684;URL&#x9700;&#x8981;&#x6307;&#x5411;&#x4E00;&#x4E2A;CGI&#x811A;&#x672C;(&#x4E5F;&#x5C31;&#x662F;&#x5728;cgi-bin&#x6216;&#x8005;ht-bin&#x4E2D;&#x7684;&#x6587;&#x4EF6;)&#x3002;CGIHTTPRequestHandler&#x7EE7;&#x627F;&#x81EA;SimpleHTTPRequestHandler&#xFF0C;&#x6240;&#x4EE5;&#x4E5F;&#x53EF;&#x4EE5;&#x5904;&#x7406;GET&#x65B9;&#x6CD5;&#x548C;HEAD&#x65B9;&#x6CD5;&#x7684;&#x8BF7;&#x6C42;&#x3002;&#x6B64;&#x65F6;&#xFF0C;&#x5982;&#x679C;URL&#x6307;&#x5411;CGI&#x811A;&#x672C;&#x65F6;&#xFF0C;&#x670D;&#x52A1;&#x5668;&#x5C06;&#x811A;&#x672C;&#x7684;&#x8FD0;&#x884C;&#x7ED3;&#x679C;&#x4F20;&#x9001;&#x5230;&#x5BA2;&#x6237;&#x7AEF;&#xFF1B;&#x5F53;&#x6B64;&#x65F6;URL&#x6307;&#x5411;&#x9759;&#x6001;&#x6587;&#x4EF6;&#x65F6;&#xFF0C;&#x670D;&#x52A1;&#x5668;&#x5C06;&#x6587;&#x4EF6;&#x7684;&#x5185;&#x5BB9;&#x4F20;&#x9001;&#x5230;&#x5BA2;&#x6237;&#x7AEF;&#x3002;</p>
<p>&#x66F4;&#x8FDB;&#x4E00;&#x6B65;&#xFF0C;&#x6211;&#x53EF;&#x4EE5;&#x8BA9;CGI&#x811A;&#x672C;&#x6267;&#x884C;&#x6570;&#x636E;&#x5E93;&#x64CD;&#x4F5C;&#xFF0C;&#x6BD4;&#x5982;&#x5C06;&#x63A5;&#x6536;&#x5230;&#x7684;&#x6570;&#x636E;&#x653E;&#x5165;&#x5230;&#x6570;&#x636E;&#x5E93;&#x4E2D;&#xFF0C;&#x4EE5;&#x53CA;&#x66F4;&#x4E30;&#x5BCC;&#x7684;&#x7A0B;&#x5E8F;&#x64CD;&#x4F5C;&#x3002;&#x76F8;&#x5173;&#x5185;&#x5BB9;&#x4ECE;&#x7565;&#x3002;</p>
<h2 id="&#x603B;&#x7ED3;">&#x603B;&#x7ED3;</h2>
<p>&#x6211;&#x4F7F;&#x7528;&#x4E86;Python&#x6807;&#x51C6;&#x5E93;&#x4E2D;&#x7684;&#x4E00;&#x4E9B;&#x9AD8;&#x7EA7;&#x5305;&#x7B80;&#x5316;&#x4E86;Python&#x670D;&#x52A1;&#x5668;&#x3002;&#x6700;&#x7EC8;&#x7684;&#x6548;&#x679C;&#x5206;&#x79BB;&#x9759;&#x6001;&#x5185;&#x5BB9;&#x3001;CGI&#x5E94;&#x7528;&#x548C;&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x964D;&#x4F4E;&#x4E09;&#x8005;&#x4E4B;&#x95F4;&#x7684;&#x8026;&#x5408;&#xFF0C;&#x8BA9;&#x4EE3;&#x7801;&#x53D8;&#x5F97;&#x7B80;&#x5355;&#x800C;&#x5BB9;&#x6613;&#x7EF4;&#x62A4;&#x3002;</p>
<p>&#x5E0C;&#x671B;&#x4F60;&#x4EAB;&#x53D7;&#x5728;&#x81EA;&#x5DF1;&#x7684;&#x7535;&#x8111;&#x4E0A;&#x67B6;&#x8BBE;&#x670D;&#x52A1;&#x5668;&#x7684;&#x8FC7;&#x7A0B;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="网络01 原始服务器.html#探索的方向" class="navigation navigation-prev " aria-label="Previous page: 探索的方向">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="网络02 服务器进化.html#支持post" class="navigation navigation-next " aria-label="Next page: 支持POST">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"应用02 服务器进化","level":"6.1.2","depth":2,"next":{"title":"支持POST","level":"6.1.2.1","depth":3,"anchor":"#支持post","path":"网络02 服务器进化.md","ref":"网络02 服务器进化.md#支持post","articles":[]},"previous":{"title":"探索的方向","level":"6.1.1.6","depth":3,"anchor":"#探索的方向","path":"网络01 原始服务器.md","ref":"网络01 原始服务器.md#探索的方向","articles":[]},"dir":"ltr"},"config":{"plugins":["toggle-chapters","theme-comscore","livereload"],"root":"./content","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"theme-comscore":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"toggle-chapters":{}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Python-Tutorial","language":"zh-hans","gitbook":"*","description":"A Quick Tutorial of Python"},"file":{"path":"网络02 服务器进化.md","mtime":"2021-03-21T16:33:06.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-03-22T11:11:10.529Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    </body>
</html>

